package driver.actions;

import driver.exceptions.ExecuteException;

/**
 * Encapsulates a single robot action e.g. move robot forward, and has a method
 * for communicating to the robot to perform that action.
 *
 * @author David Martin
 */
public abstract class Action
{

  /**
   * Set up the action
   * 
   */
  public Action()
  {
  }

  /**
   * Gets the name of this action e.g. Move Forward
   *
   * @return the action name as a string
   */
  public abstract String getActionName();

  public String getSafeActionName()
  {
    return getActionName().replace(' ', '_').toLowerCase();
  }

  /**
   * This method should perform the desired action on the robot by using the
   * controller
   * E.g. move the robot forward
   */
  public abstract void execute() throws ExecuteException;
}
